#include <iostream>

using namespace std;

class Solution
{
  public:
    int hammingWeight(uint32_t n)
    {
        int count = 0;
        while (n)
        {
            if (n & 1)
            {
                ++count;
            }
            n >>= 1;
        }
        return count;
    }
};

int main()
{
    uint32_t n = 123;
    cout << Solution().hammingWeight(n) << endl;
    return 0;
}